package com.viu.technology.dao;


import com.viu.technology.dto.PageBean;

public class BaseDao {

    public static ThreadLocal<PageBean> localPage = new ThreadLocal<>();

    public PageBean getPageBean() {
        return localPage.get();
    }

    public void setLocalPage(Integer pageNum, Integer pageSize) {
        localPage.set(new PageBean(pageNum, pageSize));
    }

    public Integer getPageNum() {
        return localPage.get().getCurrentPage();
    }

    public Integer getPageSize() {
        return localPage.get().getPageSize();
    }

    public static void setPageBean(Integer pageNum,Integer pageSize) {
        localPage.set(new PageBean(pageNum, pageSize));
    }
}
